<template>
  <div>
    <table>
      <tr v-for="(good,index) in goods" v-bind:key="index">
        <td>{{good.id}}</td>
        <td>{{good.name}}</td>
      </tr>
    </table>
  </div>
</template>

<script>
export default {
  name: "goods",
  data(){
    return {
      goods:[],
    }
  },
  created() {
    //发请求，获取数据
    this.axios.get(this.baseUrl+"goods/all")
    .then(res =>{
      //得到数据
      this.goods=res.data.data;
    })
  }
}
</script>

<style scoped>

</style>













